﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SC.GirdManage.Common;
using SC.GridManage.API.Read.Application.command.PhysicalGrid;

namespace SC.GridManage.API.Read.Controllers
{
    /// <summary>
    /// 物理网格控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PhysicalGridController : ControllerBase
    {
        private readonly IMediator mediator;

        public PhysicalGridController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 获取物理网格列表API
        /// </summary>
        /// <param name="comdand"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<ApiResult<List<PhysicalGridDTO>>> GetGridList([FromQuery]GetPhysicalGridListCommand comdand) { 
            return mediator.Send(comdand);
        }
    }
}
